From 0735aa1c2ee0faa8c9b75a2f1c31870db6597f79 Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Fri, 6 Sep 2013 18:44:57 +0300 Subject: [PATCH] gdk_pixbuf_get_from_source: only reuse surfaces with matching format Otherwise the conversion functions will return rubbish. https://bugzilla.gnome.org/show_bug.cgi?id=707445 --- gdk/gdkpixbuf-drawable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdk/gdkpixbuf-drawable.c b/gdk/gdkpixbuf-drawable.c index 59698f8ac0..b6d238e390 100644 --- a/gdk/gdkpixbuf-drawable.c +++ b/gdk/gdkpixbuf-drawable.c @@ -248,7 +248,8 @@ gdk_pixbuf_get_from_surface (cairo_surface_t *surface, 8, width, height); - if (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE) + if (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE && + cairo_image_surface_get_format (surface) == gdk_cairo_format_for_content (content)) surface = cairo_surface_reference (surface); else { -- 2.30.2